<style>
.btn.btn-danger-o {
    background: transparent;
    color: {{main.syscolor || '#7c1cc9'}};
    border: 1px solid {{main.syscolor || '#7c1cc9'}};
}
</style>
<div class="fui-page fui-page-current page-goods-list" style="background: {{main.syscolor || '#7c1cc9'}};">
<div class='fui-content' style="top:0;background:none;padding-bottom:0">
	<div style="padding:2rem;margin-top:1rem">
		<div class="top" style="margin-bottom:-1.3rem;z-index:108">
			<div class="c">
					<img style="width:3rem;height:3rem;border-radius:100%" src="{{tomedia(pagedata.member.avatar) || '../core/resource/images/no-wxapp.png'}}"  />
			</div>
		</div>
		<div class="fui-code" style="background: linear-gradient(#fdf5d8, #fcd7f7);border-radius: 0.5rem;padding-bottom:1rem">		
			 <div class="fui-line-title" style="padding-top:1.3rem">
					<div class="bold">{{pagedata.member.nickname}}</div>
					<a href="javascript:;" href="tel:{{pagedata.member.mobile}}"  style="color:#999;font-size:0.7rem">客户电话：{{pagedata.member.mobile}} <i class="icon icon-phone" style="font-size:0.6rem"></i></a>
			</div>
			<div class="fui-cell-group" style="padding:0.5rem;background:none">
				<div class="fui-cell-title bold c" style="font-size:0.9rem">
						在线收款
				</div>
				<div class="fui-cell">
						<div class="fui-cell-label">收款金额：</div>
						<div class="fui-cell-info">
							<input type="member" placeholder="请输入收款金额" class="fui-input bold" style="font-size:1rem" ng-model="pagedata.money"/>
						</div>
				</div>
			</div>
			<div class="content-empty" style="margin-top:0.5rem;">
				<a ng-if="pagedata.member.ispass!=1" href="javascript:" ng-click="pagedata.getpay();" class="weui_btn weui_btn_primary" style="border-radius: 1rem;width:  9rem;font-size: .75rem">
					选择付款方式
				</a>
				<a ng-if="pagedata.member.ispass==1" class="weui_btn weui_btn_default" style="border-radius: 1rem;width:  9rem;font-size: .75rem">
					付款码已过期
				</a>
			</div>
		</div>
		</div>
	</div>
</div>
<style>
.closepay {
    width: 1.5rem;
    height: 1.5rem;
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    border-radius: 1.5rem;
    text-align: center;
    line-height: 1.5rem;
    font-size: 1.3rem;
    color:{{main.syscolor||'#ff5555'}};
    z-index: 18;
}
</style>
<div ng-if="pagedata.showpay" class="popup">
	<div class="popup-body">
		<div class="popup-bottom">
		<i class="closed icon icon-cuowu" ng-click="pagedata.showpay=false"></i>
		<div class='fui-page-title bold c' style="padding-top:1.3rem;padding-bottom:0;margin-top:0;font-size:1rem">收款方式</div>
		<div class='fui-page-title bold c' style="margin-top:0"><span>￥</span><span class="bigprice core-pay-fee" style="font-size:1.6rem">{{pagedata.paydata.fee}}</span></div>
		<div class="weui_cells weui_cells_radio2" style="margin-top:10px;max-height:16rem;overflow-y:scroll">
			<label ng-if="pagedata.paydata.credit2.isdi!=1" class="weui_cell weui_check_label">
					<div class='weui_cell_hd' style="width:auto;">
						<i class="icon icon-icon green" style="font-size:1.6rem"></i>
					</div>
					<div class="weui_cell_bd weui_cell_primary">
						<div class="title bold">余额支付 <span>（可用 <span class='text-danger'>￥{{pagedata.paydata.credit || '0.00'}}</span>）</span></div>
					</div>
					<div class="weui_cell_ft" ng-click="pagedata.paydata.type='credit'">
						<input type="radio" name="type" class="weui_check" ng-checked="pagedata.paydata.type=='credit'">
						<span class="weui_icon_checked"></span>
					</div>
			</label>
			<div ng-if="pagedata.paydata.credit2.isdi==1" class="weui_cell">
					<div class='weui_cell_hd' style="width:1.6rem;">
					</div>
					<div class="weui_cell_bd weui_cell_primary">
						余额（可用 <span class='text-danger'>￥{{pagedata.paydata.credit || '0.00'}}</span>）
					</div>
					<div class="weui_cell_ft">
						-{{price(pagedata.paydata.credit2.difee) || '0.00'}}
						<span style="width:2rem"><input class="weui_switch" type="checkbox" ng-checked="pagedata.paydata.di_open=='credit2'" ng-click="toogle(pagedata.paydata,'di_open',['credit2',0]);pagedata.paydata.di_fee=pagedata.paydata.credit2.difee"></span>
					</div>
			</div>
			<div ng-repeat="item in pagedata.paydata.creditdata" ng-class="{'weui_cell':1,'disabled':item.value<=0}" ng-if="item.isclose != 1">
					<div class='weui_cell_hd' style="width:1.6rem;">	
					</div>
					<div class="weui_cell_bd weui_cell_primary">
						{{item.title}}（可用 <span class='text-danger'>￥{{item.value || '0.00'}}</span>）
						
					</div>
					<div class="weui_cell_ft">
						<span style="margin-right:0.3rem">-{{price(item.difee)|| '0.00'}}</span>
						<input class="weui_switch" type="checkbox" ng-checked="pagedata.paydata.di_open==item.field" ng-click="toogle(pagedata.paydata,'di_open',[item.field,0]);pagedata.paydata.di_fee=item.difee">
					</div>
			</div>
        </div>
		<a href="javascript:;" ng-click="pagedata.pay();" class="weui_btn weui_btn_primary" style="margin:0.5rem 1rem;border-radius:1rem">确认收款</a>
</div>
</div>
</div>
<script type="text/javascript">
scope.pagedata.getpay=function(){
	if(!scope.pagedata.money || scope.pagedata.money<=0){
		scope.message('请输入收款金额！','error');
		return false;
	}
	if(!scope.pagedata.member.id || scope.pagedata.member.id<=0){
		scope.message('用户不存在！','error');
		return false;
	}
	scope.get('jy_merch/manage.inpay/getpay/fee='+scope.pagedata.money+'&mid='+scope.pagedata.member.id,function(res){
		scope.pagedata.paydata=res;
		scope.pagedata.showpay=true;
		scope.$evalAsync();
	});
}
scope.pagedata.pay=function(){
	var post={
		'mid':scope.pagedata.member.id,
		'fee':scope.pagedata.money,
		'di_open':scope.pagedata.paydata.di_open,
		'di_fee':scope.pagedata.paydata.di_fee,
	};
	scope.post_json('jy_merch/manage.inpay/post/',post);
}
</script>